---
title: SAIF.Services.Printing operations and processes
summary: Business and technical operations supported by this library.
status: draft
owner: SAIF Case Management
last_reviewed: 2026-08-21
library: SAIF.Services.Printing
reference_type: embedded
---

# SAIF.Services.Printing operations and processes

This page is the operation catalog and cross-operation hub for this library. Each operation's detailed, step-by-step logic lives in its own page under `operations/`.

## Operation catalog
| Operation | Intent | Trigger | Inputs | Outputs | Rules | Tables | SQL |
| --- | --- | --- | --- | --- | --- | --- | --- |
| [Preview a document via xPression](operations/preview-document-xpresso.md) | Render a document to PDF bytes for preview | Caller invokes `clsPrint.previewDocument`/`previewPDF` | `Package`, `XML`, `OutputProfile`, `Application` | PDF byte array | — | — | — |
| [Print raw PDF bytes](operations/print-pdf.md) | Send rendered PDF bytes to a physical printer | Caller invokes `clsPrint.printPDF` | PDF bytes, `Printer`, `PlexMode`, `Copies`, `ScaleMode` | Boolean success flag | — | — | — |
| [Distribute a document](operations/distribute-document.md) | Deliver a document synchronously (SOAP) or asynchronously (MSMQ) | Caller invokes `clsPrint.distributeDocument` | `Package`, `XML`, distribution properties, `Asynchronous` flag | Boolean success flag | — | — | — |
| [MSMQ transaction lifecycle](operations/msmq-transaction-lifecycle.md) | Batch multiple queued sends under one MSMQ transaction | Caller invokes `StartMQTransaction`/`EndMQTransaction` | — | Committed/aborted transaction | — | — | — |
| [xDashBoard passthrough operations](operations/xdashboard-passthrough.md) | Forward xDashBoard requests directly to the xPression SOAP service | Caller invokes `xpublishDocument`, `xpreviewHTML`, `xpublishAndReturnDocument`, `xdocumentsForCategory`, `xoutputProfilesForDocument`, `xcategoriesForUser` | Varies by method | Varies by method (bytes, string, string array) | — | — | — |
| [Render a letter or report](operations/render-report.md) | Build and render a report/letter's XML into PDF bytes | Caller (or `Print`/`Distribute`) invokes `Reporting.ReportBase.Render` | `overwrite` flag | Boolean success flag; populates `m_reportFile` | — | — | — |
| [Print a letter or report](operations/print-report.md) | Render (if needed) and print a report/letter | Caller invokes `Reporting.ReportBase.Print` | `printer`, `overwrite` flag | Boolean success flag | — | — | — |
| [Distribute a letter or report](operations/distribute-report.md) | Build XML (if needed) and distribute a report/letter | Caller invokes `Reporting.ReportBase.Distribute` | `overwrite` flag | Boolean success flag | — | — | — |
| [Save a rendered report to disk](operations/save-report.md) | Persist rendered report bytes to a file on disk | Caller invokes `Reporting.ReportBase.Save` | `DestinationFileName`, `overwrite` flag | Boolean (destination file exists) | — | — | — |
| [Switch output profile](operations/switch-output-profile.md) | Select the default or draft-watermark output profile | Caller invokes `Reporting.ReportBase.SetDefaultProfile`/`SetDraftProfile` | — | Updated `OutputProfile` value | — | — | — |
| [Render an SSRS report](operations/render-ssrs-report.md) | Load, parameterize, and render a report from an SSRS report definition | Caller invokes `clsRSPrint.PreviewDocument` | `ReportPath`, parameters, `Format`/`Extension` | Rendered report bytes | — | — | — |
| [Add or clear SSRS report parameters](operations/manage-ssrs-parameters.md) | Maintain the parameter set used on the next SSRS render | Caller invokes `clsRSPrint.AddParameter`/`ClearParameters` | Parameter name/value | Updated internal parameter collection | — | — | — |
| [Distribute an SSRS report](operations/distribute-ssrs-report.md) | Declared distribution capability for SSRS reports | Caller invokes `clsRSPrint.DistributeDocument` | — | Throws `NotImplementedException` | — | — | — |

## Process flow diagram
The following diagram visualizes the primary operational flow for generating and delivering a document through the xPression facade.

```mermaid
flowchart TD
	Start([Caller requests document action]) --> BuildXml[Build/obtain XML via Reporting.ReportBase.Create]
	BuildXml --> Render[Render via clsPrint.previewDocument]
	Render --> Decision{Delivery mode?}
	Decision -->|Print| Print[clsPrint.printPDF]
	Decision -->|Distribute sync| DistSync[clsPrint.distributeDocument - SOAP]
	Decision -->|Distribute async| DistAsync[Queue CompositeRequestClass on MSMQ]
	Decision -->|Save| Save[Write bytes to DestinationFileName]
	Print --> EndOk([Delivered])
	DistSync --> EndOk
	DistAsync --> EndOk
	Save --> EndOk
```

## Failure and edge-case behavior
- `clsRSPrint.DistributeDocument` always throws `NotImplementedException` — SSRS report distribution is declared but not implemented.
- `clsPrint.printPDF` returns `True` unconditionally; the result of the underlying SOAP call is not checked.
- `Reporting.ReportBase.Render`/`Print`/`Distribute`/`Save` catch exceptions internally, record them as an `ErrorDetail` in the `Errors` list, and return `False`/skip rather than propagating the exception to the caller.
- `clsPrint.distributeDocument` (async path) rolls back the MSMQ transaction on any exception and re-throws.

## Related documentation
- [Index](index.md)
- [Overview](overview.md)
- [Architecture](architecture.md)
- [Dependencies](dependencies.md)
- [Business rules](business-rules.md)
- [API reference](api/index.md)

## Sources
- `SAIF.Services.Printing\clsPrint.vb`
- `SAIF.Services.Printing\clsRSPrint.vb`
- `SAIF.Services.Printing\Reporting\ReportBase.vb`
